﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text.RegularExpressions;

namespace TrainingsApp.IPADApp.Themes {
    public partial class Sitev2_2 : System.Web.UI.MasterPage
    {
        public bool IsIPad { get; set; }
        protected void Page_Load(object sender, EventArgs e)
        {
            if ((base.Request.UrlReferrer == null) || (base.Request.UrlReferrer.ToString().IndexOf("MobileShow") < 0))
            {
                string input = base.Request.ServerVariables["HTTP_USER_AGENT"];
                Regex regex = new Regex(@"android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|symbian|treo|up\\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino", RegexOptions.Multiline | RegexOptions.IgnoreCase);
                if (regex.IsMatch(input))
                {
                    this.IsIPad = true;
                }
            }

        }
    }
}